<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script th:inline="javascript">
        var msg = 'Hello ' + [[${userName}]] + '！';
        alert(msg);
    </script>
</head>
<body>
<a th:if="${flag == 'yes'}" th:href="@{http://www.ktjiao.com/}">ktjiaoyu</a><br/>
<a th:unless="${flag == 'no'}" th:href="@{http://www.czkt.com/}">czkt</a>
<div th:switch="${sex}">
    <p th:case="'woman'">她是一个姑娘...</p>
    <p th:case="'man'">这是一个爷们!</p>
    <!-- *: case的默认的选项 -->
    <p th:case="*">未知性别的一个家伙。</p>
</div>
</body>
</html>